<?php 
   include "counter.php";
# To test for whether cookies are enabled
   setcookie("cookiesenabled", "true");
   pagestart ();
# Fetch parameters
  $url = $counter->get_input("url", "", "get");
 ?>
<html>
<?php pagehead("Login") ?>
<body>
<?php pagetop("Log In") ?>
<h2>Log in</h2>
<form method="post" action="<?php print $secure_counter_site ?>/cgi-bin/runscript/login.cgi">
<table>
<tr><td>Reg. number or email<td><input name="user">
<tr><td>Password<td><input type="password" name="password">
<tr><td><td><input type="submit" name="enter" value="Enter">
</table>
<input type="hidden" name="url"
<?php 
 $http_host = getenv("HTTP_HOST");
 if ($url != "") {
    echo "value=\"$url\"";
 } else if (preg_match("!^http://$http_host!", getenv("HTTP_REFERER"))) {
      echo "value=\"", getenv("HTTP_REFERER"), "\"";
 } else {
      echo "value=\"/person/\"";
}
?>
>

</form>
<p>The password (also called user key) is something like 12345-67890,
and should have been in the message you got from the Linux Counter
when you registered. </p>
<strong>Note:</strong> You must have <em>cookies</em> enabled in
order to log in. An experimental workaround is in place to allow you to
edit your home page without cookies - but this is not finished, and
does not work for everything. Please report problems to <?php print emailCloaking("help@counter.li.org", 0) ?>
<hr>
<h2>Forgotten Key/Password</h2>
<p>
If you do not have your key, try to enter the E-mail address you used for
registering below, and see if you get it E-mailed to you. </p>

<form method="get" action="/cgi-bin/runscript/emailquery.cgi">
  Email: <input name="email" size="30" maxlength="160"> <br>
  <input TYPE="submit" VALUE="Email me!"> <input TYPE="reset" VALUE="Clear">
</form>
If you don't have access to the email you registered any more, try the <a href="<?php print $counter_site ?>/lost-key.php">Lost Key Request</a> page.

<p>Someone should respond shortly. </p>
<hr>
<h2>Site security</h2>
<a href="http://www.cacert.org/" target="_blank"><img src="/gifs/cacert-grey2.png" alt="www.cacert.org" style="border-width: 0px;" /></a><em> This site is secured with a certificate from CAcert. The first time when you visit a part of our site that is secured with a certificate from CAcert, you will get a popup from you browser telling you that you do not trust this site. To get rid of that popup in future you can install the certificate from the Linux Counter site.<br>
Alas, not many applications have installed by default the CAcert Class 1 and Class 3 root certificates that the Linux Counter certificate is based on. Thus, when installing the Linux Counter certificate your browser will probably complain about the fact that their is not enough information to verify the certificate. This means that your browser is missing the CAcert Class 1 and Class 3 root certificates. You can get these certificates from <a href="http://www.cacert.org/index.php?id=3">CAcert</a>. After installing these certificates the validation of the Linux Counter certificate will be correct.</em>

<?php pagebottom("yes") ?>
</body>
</html>
